package pe.edu.upc.dsd.epica.web;

import java.io.IOException;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.apache.log4j.Logger;

import pe.edu.upc.dsd.epica.util.Session;

public class CerrarSesionServlet extends HttpServlet {

	private static final long serialVersionUID = 1L;
	private final static Logger logger = Logger.getLogger(CerrarSesionServlet.class);
	
	@Override
	protected void doGet(HttpServletRequest req, HttpServletResponse resp)
			throws ServletException, IOException {
		try {
			Session.Cerrar(req.getSession());		
			req.getRequestDispatcher("login.jsp").forward(req, resp);
		} catch (Exception e) {
			logger.warn("Error de Cierre de Session");
		}
		
	}

}
